From cce9b16fc66ed626008f883ea1a805d339372905 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 7 Sep 2005 09:42:47 +0000 Subject: [PATCH] Small plan9 loader patch from Tim Newsham. --- tools/libxc/xc_load_aout9.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/libxc/xc_load_aout9.c b/tools/libxc/xc_load_aout9.c index 93ec251cc4..bc76bae3b2 100644 --- a/tools/libxc/xc_load_aout9.c +++ b/tools/libxc/xc_load_aout9.c @@ -14,7 +14,6 @@ #define round_pgup(_p) (((_p)+(PAGE_SIZE-1))&PAGE_MASK) -#define round_pgdown(_p) ((_p)&PAGE_MASK) #define KZERO 0x80000000 #define KOFFSET(_p) ((_p)&~KZERO) @@ -49,7 +48,7 @@ parseaout9image( struct domain_setup_info *dsi) { struct Exec ehdr; - unsigned long start, txtsz, end; + unsigned long start, dstart, end; if (!get_header(image, image_size, &ehdr)) { ERROR("Kernel image does not have a a.out9 header."); @@ -61,9 +60,9 @@ parseaout9image( return -EINVAL; } - start = round_pgdown(ehdr.entry); - txtsz = round_pgup(ehdr.text); - end = start + txtsz + ehdr.data + ehdr.bss; + start = ehdr.entry; + dstart = round_pgup(start + ehdr.text); + end = dstart + ehdr.data + ehdr.bss; dsi->v_start = KZERO; dsi->v_kernstart = start; @@ -85,19 +84,18 @@ loadaout9image( struct domain_setup_info *dsi) { struct Exec ehdr; - unsigned long start, txtsz; + unsigned long start, dstart; if (!get_header(image, image_size, &ehdr)) { ERROR("Kernel image does not have a a.out9 header."); return -EINVAL; } - start = round_pgdown(ehdr.entry); - txtsz = round_pgup(ehdr.text); - copyout(xch, dom, parray, - start, image, sizeof ehdr + ehdr.text); - copyout(xch, dom, parray, - start+txtsz, image + sizeof ehdr + ehdr.text, ehdr.data); + start = ehdr.entry; + dstart = round_pgup(start + ehdr.text); + copyout(xch, dom, parray, start, image + sizeof ehdr, ehdr.text); + copyout(xch, dom, parray, dstart, + image + sizeof ehdr + ehdr.text, ehdr.data); /* XXX load symbols */ -- 2.30.2